package errors

import (
	"errors"
	"fmt"
)

func ErrNotFoundColumn(columnName string) error {
	return fmt.Errorf("orm: column %s not found", columnName)
}

func ErrInvalidExpression(exp any) error {
	return fmt.Errorf("orm: invalid expression type: %T", exp)
}

func ErrUnknownTable(entity any) error {
	return fmt.Errorf("orm: unknown table: %s", entity)
}

func ErrUnknownAssignable(val any) error {
	return fmt.Errorf("orm: unknown assignable: %s", val)
}

func ErrUnSupportShardingOperation(op string) error {
	return fmt.Errorf("orm: unsupport sharding operation: %s", op)
}

func ErrUnSupportShardingPredicate(p any) error {
	return fmt.Errorf("orm: unsupport sharding predicate: %s", p)
}

func ErrUnknownShardingDB(dbName string) error {
	return fmt.Errorf("orm: unknown sharding db: %s", dbName)
}

var ErrNoRows = errors.New("orm: no rows")

var ErrNoGroupBy = errors.New("orm: no group by column when using having")

var ErrJoinStat = errors.New("orm: join stat err")

var ErrNotSlicePtr = errors.New("orm: vals not slice ptr")

var ErrNotPointToStruct = errors.New("orm: val not point to a struct")

var ErrCountColumns = errors.New("orm: column count mismatch")

var ErrNotFoundValues = errors.New("orm: no values")
